package com.panda.springcloud.config;/**
 * @author 乐于吕
 * * @date 2024/10/24
 */

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.context.annotation.Configuration;

import java.util.Date;

/**
 *@Author: 乐于吕
 *@CreateTime: 2024-10-24
 *@Description:  MybatisPlusConfig
 */

@Configuration
public class MybatisPlusConfig implements MetaObjectHandler {


    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("createdate",new Date(),metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        this.setFieldValByName("createdate",new Date(),metaObject);
    }
}
